How to return multiple values from a function